{block name="circle_layout"}
	{include file="common:common_layout"}
{/block}
{extend name="common/layout" /}
{block name="style"}{/block}
{block name="content"}
<div class="base-layout">
    <div class="mainbox">
        {include file="circle:manage:top" /}

        <table class="base-table-style">
            <thead>
            <tr>
                <th class="w30"></th>
                <th>成员</th>
                <th class="w100">申请时间</th>
                <th class="w180">申请理由</th>
                <th class="w180">自我介绍</th>
                <th class="w90">操作</th>
            </tr>
            <?php if(!empty($cm_list)){?>
            <tr>
                <td class="tc"><input id="all" class="checkall" type="checkbox" /></td>
                <td colspan="20"><label for="all" class="handle-btn"><i class="ac0"></i>全选</label>
                    <a href="javascript:void(0);" class="handle-btn" nctype="batchbutton" uri="{:url('circle/manage/applying_manage')}?type=yes&c_id=<?php echo $c_id;?>" name="cm_id"><i class="ac6"></i>通过</a>
                    <a href="javascript:void(0);" class="handle-btn" nctype="batchbutton" uri="{:url('circle/manage/applying_manage')}?type=no&c_id=<?php echo $c_id;?>" name="cm_id" confirm="确定要拒绝申请吗？"><i class="ac7"></i>拒绝</a></td>
            </tr>
            <?php }?>
            </thead>
            <tbody>
            <?php if(!empty($cm_list)){?>
            <?php foreach (($cm_list) as $val){?>
            <tr>
                <td><input class="checkitem" type="checkbox" value="<?php echo $val['member_id'];?>"></td>
                <td><dl class="member-base"><dt class="name"><a href="javascript:void(0)" target="_blank"><?php echo $val['member_name'];?></a></dt><dd class="member-avatar-s"><img src="<?php echo $val['member_avatar'];?>" /></dd>
                </dl></td>
                <td><?php echo date('Y-m-d', $val['cm_applytime']);?></td>
                <td><div class="long-text tip" title="<?php echo $val['cm_applycontent'];?>" style="color:#2D917A;"><?php echo $val['cm_applycontent'];?></div></td>
                <td><div class="long-text tip" title="<?php echo $val['cm_intro'];?>" style="color:#F66"><?php echo $val['cm_intro'];?></div></td>
                <td class="handle"><a href="javascript:void(0);" onclick="applyingManage('yes', <?php echo $val['member_id'];?>);"><i class="ac6"></i>通过</a>&nbsp;|&nbsp;<a href="javascript:void(0);" onclick="applyingManage('no', <?php echo $val['member_id'];?>);"><i class="ac7"></i>拒绝</a></td>
            </tr>
            <?php }?>
            <?php }else{?>
            <tr>
                <td colspan="20" class="noborder"><p class="no-record">没有符合条件的记录</p></td>
            </tr>
            <?php }?>
            </tbody>
            <?php if(!empty($cm_list)){?>
            <tfoot>
            <tr>
                <th class="tc"><input id="all" class="checkall" type="checkbox" /></th>
                <th colspan="20"><label for="all" class="handle-btn"><i class="ac0"></i>全选</label>
                    <a href="javascript:void(0);" class="handle-btn" nctype="batchbutton" uri="{:url('circle/manage/applying_manage')}?type=yes&c_id=<?php echo $c_id;?>" name="cm_id"><i class="ac6"></i>通过</a>
                    <a href="javascript:void(0);" class="handle-btn" nctype="batchbutton" uri="{:url('circle/manage/applying_manage')}?type=no&c_id=<?php echo $c_id;?>" name="cm_id" confirm="确定要拒绝申请吗"><i class="ac7"></i>拒绝</a></th>
            </tr>
            </tfoot>
            <?php }?>
        </table>
    </div>
    <div class="sidebar">
        {include file="circle:manage:sidebar" /}

    </div>
</div>
<script src="__CIRCLE_RESOURCE__/js/circle_manage.js"></script>
<script src="__SITE_RESOURCE__/js/jquery.poshytip.min.js"></script>
	
<script>
    function applyingManage(type, id){
        _uri = "<?php echo url('circle/manage/applying_manage');?>?type="+type+"&c_id=<?php echo $c_id;?>&cm_id="+id;
        if(type == 'yes'){
            ajaxget(_uri);
        }else if(type == 'no'){
            showDialog('确定要拒绝申请吗？', 'confirm', '', function(){
                ajaxget(_uri);
            });
        }
    }
    //Ajax提示
    $(function(){
        $('.tip').poshytip({
            className: 'tip-yellowsimple',
            showTimeout: 1,
            alignTo: 'target',
            alignX: 'center',
            alignY: 'top',
            offsetY: 5,
            allowTipHover: false
        });
    });
</script>
{/block}